package com.xcx.robot;

import com.xcx.robot.mirai.QuickStart;
import com.xcx.robot.mirai.key.KeyWord;
import com.xcx.robot.mirai.web.NettyServer;
import com.xcx.robot.spring.ApplicationContextHelper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
@MapperScan("com.xcx.robot.mirai.mp.mapper")
public class RobotApplication {

    public static void main(String[] args) throws Exception {
        SpringApplication.run(RobotApplication.class, args);
        //加载菜单
        KeyWord.menu();
        QuickStart rabbitBot = ApplicationContextHelper.getBean(QuickStart.class);
        assert rabbitBot != null;
        //启动bot
        rabbitBot.startBot();
        //websocket监听
        NettyServer nettyServer = new NettyServer(12345);
        nettyServer.start();
    }

}
